// 计算年平均电话费用

#include <iostream>
using namespace std;

void GetMonthCost(int month, float* cost);

int main() {
    float jan, feb, mar, apr, may, jun;
    float jul, aug, spet, oct, nov, dec;
    float ave;

    GetMonthCost(1, &jan);
    GetMonthCost(2, &feb);
    GetMonthCost(3, &mar);
    GetMonthCost(4, &apr);
    GetMonthCost(5, &may);
    GetMonthCost(6, &jun);
    GetMonthCost(7, &jul);
    GetMonthCost(8, &aug);
    GetMonthCost(9, &spet);
    GetMonthCost(10, &oct);
    GetMonthCost(11, &nov);
    GetMonthCost(12, &dec);

    ave = (jan + feb + mar + apr + may + jun + jul + aug + spet + oct + nov + dec) / 12.0f;
    cout << "年平均电话费用为: " << ave << "\n";
}

void GetMonthCost(int month, float* cost) {
    cout << "请输入 " << month << " 月份的电话费: ";
    cin >> *cost;
}